﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Grow.EventBus.Cap.PublisherDomainEvents
{
    public class PublisherDomainEventDto
    {
        public PublisherDomainEventDto(Guid id, string eventName, string eventBody, PublisherDomainEventStatus eventStatus, int retryCount, DateTimeOffset sendAt, DateTimeOffset? lockEndTime, DateTimeOffset? expireTime)
        {
            Id = id;
            EventName = eventName;
            EventBody = eventBody;
            EventStatus = eventStatus;
            RetryCount = retryCount;
            SendAt = sendAt;
            LockEndTime = lockEndTime;
            ExpireTime = expireTime;
        }

        /// <summary>
        /// Id
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 事件名称
        /// </summary>
        public string EventName { get; set; }

        /// <summary>
        /// 事件内容
        /// </summary>
        public string EventBody { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public PublisherDomainEventStatus EventStatus { get; set; }

        /// <summary>
        /// 已重试次数
        /// </summary>
        public int RetryCount { get; set; }

        /// <summary>
        /// 锁定结束时间
        /// </summary>
        public DateTimeOffset SendAt { get; set; }

        /// <summary>
        /// 锁定结束时间
        /// </summary>
        public DateTimeOffset? LockEndTime { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTimeOffset? ExpireTime { get; set; }
    }
}
